#!/bin/bash
tcpESTAB=`ss -an |awk '/^tcp/{++S[$2]}END{for(a in S) print a,S[a]}'|grep 'ESTAB'|awk '{print $2}'`
if [[ "${tcpESTAB}" == "" ]];then
	echo "0";
else
	echo "${tcpESTAB}"
fi
